<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
  <head>
    <base href="<%=basePath%>" />
    <title>Allocation Bills for Shared Area</title>
    <script type="text/javascript">
		var path = "<%=basePath%>"; 
	</script>
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
	<meta http-equiv="description" content="This is my page" />
	<link rel="stylesheet" type="text/css" href="<%=basePath%>beshs/css/content.css" />
	<link type="text/css" href="<%=basePath%>beshs/css/frame_style.css" rel="stylesheet" />
	<link type="text/css" href="<%=basePath%>beshs/css/element_style.css" rel="stylesheet" />
	<script type="text/javascript" src="<%=basePath%>resources/jquery/jquery-1.7.2.min.js"></script>
	<!-- 系统通用资源 -->
	<jsp:include page="/resources/resource-refer/common-resource-reference.jsp" />
	<!-- 用户访问菜单路径 -->
	<jsp:include page="/resources/usertrace/common-uservisit-reference.jsp" />
  	<!-- iframe高度自适应 -->
	<script type="text/javascript">
        function getOsName() { 
    		var OsObject = ""; 
		   	if(navigator.userAgent.indexOf("MSIE")>0) { 
		    	return "MSIE"; 
		   	} 
		   	if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){ 
		        return "Firefox"; 
		   	} 
		   	if(isSafari=navigator.userAgent.indexOf("Safari")>0) { 
		        return "Safari"; 
		   	}  
		  	if(isCamino=navigator.userAgent.indexOf("Camino")>0){ 
		        return "Camino"; 
		   	} 
		   	if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0){ 
		        return "Gecko"; 
		   	} 
		} 
        
        /** 根据浏览器类型选择iframe自适应方式 **/
        function setIframeHeightAutosize() {
        	//获取Iframe对象 ie和firefox都可以获得
        	var usrIframe = document.getElementById("userResultPage"); 
        	try{
                if(getOsName() == 'MSIE'){
                    var lbHeight = usrIframe.document.body.scrollHeight; //IE
                    usrIframe.style.height =  lbHeight + "px"; 
                }else if(getOsName() == 'Firefox'){
                    var lfHeight = usrIframe.contentDocument.body.scrollHeight; //FireFox 
                    if(lfHeight==0) lfHeight=400;
                    usrIframe.height = lfHeight + "px";   
                } else {
                    usrIframe.style.height = 400 + "px";
                }          
            } catch (ex){}
		}
		
		$(function() {
			setIframeHeightAutosize();
		})
    </script>
  </head>
  <body>
  	<div class="content_all">
  		<!--导航条-->
  		<div class="insertinfo_table">
		  	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		  		<tr>
		  			<th style="text-align: center;" colspan="6" >Allocation Bills for Shared Area</th>
		  		</tr>
		  		<tr>
		  			<th>Shared Area Name：</th>
		          	<td><s:property value='shareAreaResult.shareName' /></td>
		        	<th>Allocation Period Start</th>
		        	<td>
		        		<s:date name='shareAreaResult.startDate' format='yyyy-MM-dd' nice='false' />
		        	</td>
		        	<th>Allocation Period End</th>
		        	<td>
		        		<s:date name='shareAreaResult.endDate' format='yyyy-MM-dd' nice='false' />
		        	</td>
		        </tr>
		        <tr>
		          	<th>Allocation Method：</th>
		          	<td>
		          		<s:if test="shareAreaResult.shareType==1">Process Allocation</s:if>
		          		<s:if test="shareAreaResult.shareType==2">Charge Allocation</s:if>
		          	</td>
		          	<th>Heating Season Start Date</th>
		        	<td>
		        		<s:date name='shareArea.startDate' format='yyyy-MM-dd' nice='false' />
		        	</td>
		        	<th>Heating Season End Date</th>
		        	<td>
		        		<s:date name='shareArea.endDate' format='yyyy-MM-dd' nice='false' />
		        	</td>
		        </tr>
		        <tr>
		        	<th>Contributor</th>
		        	<td>
		        		<s:property value="shareAreaResult.shareMan" />
		        	</td>
		        	<th>Allocation Time</th>
		        	<td>
		        		<s:date name='shareAreaResult.shareDate' format='yyyy-MM-dd HH:mm:ss' nice='false' />
		        	</td>
		        	<th>Shared Area：</th>
		          	<td><s:property value='shareArea.areaName' /></td>
		        </tr>
		        <tr>
		        	<th>City：</th>
		          	<td>
		          		<s:property value="pageCityMap.get(shareAreaResult.provinceCityID)" />
		          		-
		          		<s:property value="pageCityMap.get(shareAreaResult.capitalCityID)" />
		          		<s:if test="pageCityMap.get(shareAreaResult.districtCityID)!=null">
		          			-
		          			<s:property value="pageCityMap.get(shareAreaResult.districtCityID)" />
		          		</s:if>
		          	</td>
		          	<th>Project：</th>
		          	<td><s:property value='project.projectName' /></td>
		          	<th>District：</th>
		          	<td><s:property value='community.communityName' /></td>
		        </tr>
		        <tr>
		        	<th>Total Heat Users：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.zero">
		          			<s:param value='shareAreaResult.heatRoomSum' />
		          		</s:text>
		          	</td>
		          	<th>Total Heat Users not involved in Metering and Charging：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.zero">
		          			<s:param value='shareAreaResult.nomeasureRoomSum' />
		          		</s:text>
		          	</td>
		          	<th>Total Heating Area：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.three">
		          			<s:param value='shareAreaResult.heatAreaSum' />
		          		</s:text>
		          		m&sup2;
		          	</td>
		        </tr>
		        <tr>
		        	<th>Total Allocators：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.zero">
		          			<s:param value='shareAreaResult.assignMeterSum' />
		          		</s:text>
		          	</td>
		          	<th>Total Radiator Weight：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.two">
		          			<s:param value='shareAreaResult.sinkWeightSum' />
		          		</s:text>
		          	</td>
		        	<th>Total Heating Area not involved in Heat Charge by Metering：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.three">
		          			<s:param value='shareAreaResult.nomeasureAreaSum' />
		          		</s:text>
		          		m&sup2;
		          	</td>
		        </tr>
		        <tr>
		        	<th>Heat Price by Metering：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.four">
		          			<s:param value='shareAreaResult.measureChargePrice' />
		          		</s:text>
		          		<s:if test="shareAreaResult.measureUnit==1">€/MWh</s:if>
		          		<s:if test="shareAreaResult.measureUnit==2">€/kWh</s:if>
		          		<s:if test="shareAreaResult.measureUnit==3">€/Gj</s:if>
		          	</td>
		        	<th>Heat Price by Area：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.four">
		          			<s:param value='shareAreaResult.areaChargePrice' />
		          		</s:text>
		          		€/m&sup2;
		          	</td>
		          	<th>Basic Heat Price：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.four">
		          			<s:param value='shareAreaResult.basePrice' />
		          		</s:text>
		          		€/m&sup2;
		          	</td>
		        </tr>
		        <tr>
		        	<th>Total Heat Consumption：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.three">
		          			<s:param value='shareAreaResult.areaHeatConsumeSum' />
		          		</s:text>
		          		MWh
		          	</td>
		          	<th>Reference Heat Release：</th>
		          	<td>
		          		<s:text name="fmt.number.precision.three">
		          			<s:param value='shareAreaResult.referHeatSinkAmount' />
		          		</s:text>
		          		MWh
		          	</td>
		          	<th>Total Basic Heating Charge：</th>
		          	<td>
		          		€<s:text name="fmt.number.precision.two">
		          			<s:param value='shareAreaResult.baseHeatChargeSum' />
		          		</s:text>
		          	</td>
		        </tr>
		        <tr>
		        	<th>Sum of Shared Heating Cost：</th>
		          	<td>
		          		€<s:text name="fmt.number.precision.two">
		          			<s:param value='shareAreaResult.measureHeatChargeSum' />
		          		</s:text>
		          	</td>
		        	<th>Total Heating Charge by Area：</th>
		          	<td>
		          		￥<s:text name="fmt.number.precision.two">
		          			<s:param value='shareAreaResult.nomeasureHeatChargeSum' />
		          		</s:text>
		          	</td>
		          	<th>Total Heating Charge：</th>
		          	<td>
		          		€<s:text name="fmt.number.precision.two">
		          			<s:param value='shareAreaResult.totalHeatChargeSum' />
		          		</s:text>
		          	</td>
		        </tr>
		        <tr>
		        	<th></th>
          			<td style="border:none" colspan="5">
          				<script type="text/javascript">
          					$(function() {
          						$("input[name='export']").click(function() {
          							var areaResultUID = "<s:property value='areaResultUID' />";
          							window.location = path + "beshs/shareAreaResultAction!exportAreaResultBill.do?date="+new Date()
          									+"&areaResultUID="+areaResultUID;
          						});
          						
          						$("input[name='goBack']").click(function() {
          							window.location = path + "beshs/shareAreaResultAction!queryAreaResultPage.do?date="+new Date();
          						});
          					})
          				</script>
          				<input name="export" type="button" value="Bill Export" class="s_btn"/>
            			<input name="goBack" type="button" value="Return" class="s_btn"/></td>
        		</tr>		
		    </table>
		</div>
	</div>
	<div class="clear"></div>
	<table cellpadding="0" class="frame_right" cellspacing="0" border="0" height="100%" width="100%">
  		<tr>
  			<td>
  			<!-- 根据分摊域分摊ID导航对应的用户分摊页面 -->
  				<script type="text/javascript">
  					$(function() {
  						var areaResultUID = "<s:property value='areaResultUID' />";
  	  					window.frames["userResultPage"].location = path + "beshs/userShareResultAction!queryUserPageByAreaResultUID.do?areaResultUID="+areaResultUID 
  	  							+ "&date=" + new Date();
  					});
  				</script>
  				<iframe frameborder="0" scrolling="auto" name="userResultPage" id="userResultPage" src="<%=basePath%>common/empty.jsp" height="100%" width="100%"></iframe>
  			</td>
  		</tr>
  	</table>
  </body>
</html>
